package com.crealth.model;

import java.io.Serializable;

import com.alibaba.fastjson.JSONObject;
import com.crealth.utils.Utils;

public class BankSpecialLimitModel implements Serializable {
	private static final long serialVersionUID = 2801L;
	
	private int id;  //银行的特殊限制
	private String bankName;  //银行机构名称
	private String property;  //资产名称
	private int professionType;  //职业类型
	private int yfMaxLoan;  //有房贷款上限
	private int wfMaxLoan;  //无房贷款上限
	private int maxLiabilities;  // 负债峰值
	
	public BankSpecialLimitModel() {
		bankName = "";
		property = "";
		professionType = -1;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getBankName() {
		return bankName;
	}
	public void setBankName(String bankName) {
		this.bankName = bankName;
	}
	public String getProperty() {
		return property;
	}
	public void setProperty(String property) {
		this.property = property;
	}
	public int getProfessionType() {
		return professionType;
	}
	public void setProfessionType(int professionType) {
		this.professionType = professionType;
	}
	public int getYfMaxLoan() {
		return yfMaxLoan;
	}
	public void setYfMaxLoan(int yfMaxLoan) {
		this.yfMaxLoan = yfMaxLoan;
	}
	public int getWfMaxLoan() {
		return wfMaxLoan;
	}
	public void setWfMaxLoan(int wfMaxLoan) {
		this.wfMaxLoan = wfMaxLoan;
	}
	public int getMaxLiabilities() {
		return maxLiabilities;
	}
	public void setMaxLiabilities(int maxLiabilities) {
		this.maxLiabilities = maxLiabilities;
	}

	public JSONObject toJSONObject() {
		JSONObject jsonObj = new JSONObject();
		jsonObj.put("id", id);
		jsonObj.put("bankName", bankName);
		jsonObj.put("property", property);
		jsonObj.put("professionType", professionType);		
		jsonObj.put("yfMaxLoan", yfMaxLoan);
		jsonObj.put("wfMaxLoan", wfMaxLoan);
		jsonObj.put("maxLiabilities", maxLiabilities);
		
		return jsonObj;
	}
	
	public void parseFromJson(JSONObject json) {
		id = Utils.getJsonIntValue(json, "id", 0);
		bankName = Utils.getJsonString(json, "bankName");
		property = Utils.getJsonString(json, "property");
		professionType = Utils.getJsonIntValue(json, "professionType", -1);		
		yfMaxLoan = Utils.getJsonIntValue(json, "yfMaxLoan", 0);
		wfMaxLoan = Utils.getJsonIntValue(json, "wfMaxLoan", 0);
		maxLiabilities = Utils.getJsonIntValue(json, "maxLiabilities", 0);
	}
	
	
}
